typedef HRESULT (WINAPI *TD3DXSaveTextureToFileInMemory)(
  _Out_  LPD3DXBUFFER *ppDestBuf,
  _In_   D3DXIMAGE_FILEFORMAT DestFormat,
  _In_   LPDIRECT3DBASETEXTURE9 pSrcTexture,
  _In_   const PALETTEENTRY *pSrcPalette
);

TD3DXSaveTextureToFileInMemory OldD3DXSaveTextureToFileInMemory;

DllExport HRESULT cc D3DXSaveTextureToFileInMemory(
  _Out_  LPD3DXBUFFER *ppDestBuf,
  _In_   D3DXIMAGE_FILEFORMAT DestFormat,
  _In_   LPDIRECT3DBASETEXTURE9 pSrcTexture,
  _In_   const PALETTEENTRY *pSrcPalette
)
{
	return OldD3DXSaveTextureToFileInMemory(ppDestBuf, DestFormat, pSrcTexture, pSrcPalette);
}
